# 使用 Debian 12 作为基础镜像
FROM debian:12

# 设置工作目录
WORKDIR /app

# 更新 apt 源为国内镜像
#RUN sed 's#http://deb.debian.org#https://mirrors.aliyun.com#g' -i /etc/apt/sources.list.d/debian.sources

# 安装软件包
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y vim curl
RUN apt-get install -y git ninja-build iasl bzip2 meson
RUN apt-get install -y g++-mingw-w64 mingw-w64 mingw-w64-tools mingw-w64-x86-64-dev nsis
RUN apt-get install -y python3 python3-venv python3-sphinx
RUN apt-get install -y python3-sphinx-rtd-theme
RUN apt-get install -y sudo

RUN apt-get install -y pacman-package-manager
RUN echo "# /etc/pacman.conf" > /etc/pacman.conf
RUN echo "[options]" >> /etc/pacman.conf
RUN echo "HoldPkg = pacman" >> /etc/pacman.conf
RUN echo "Architecture = auto" >> /etc/pacman.conf
RUN echo "Color" >> /etc/pacman.conf
RUN echo "CheckSpace" >> /etc/pacman.conf
RUN echo "ParallelDownloads = 5" >> /etc/pacman.conf
RUN echo "SigLevel = Never" >> /etc/pacman.conf
RUN echo "LocalFileSigLevel = Optional" >> /etc/pacman.conf
RUN echo "" >> /etc/pacman.conf
RUN echo "[mingw64]" >> /etc/pacman.conf
RUN echo "Include = /etc/pacman.d/mirrorlist.mingw" >> /etc/pacman.conf
RUN echo "" >> /etc/pacman.conf
#RUN echo "[msys]" >> /etc/pacman.conf
#RUN echo "Include = /etc/pacman.d/mirrorlist.msys" >> /etc/pacman.conf

RUN mkdir -p /etc/pacman.d
RUN echo "# /etc/pacman.d/mirrorlist.mingw" > /etc/pacman.d/mirrorlist.mingw
RUN echo "Server = https://mirrors.cloud.tencent.com/msys2/mingw/\$repo/" >> /etc/pacman.d/mirrorlist.mingw
RUN echo "# /etc/pacman.d/mirrorlist.msys" > /etc/pacman.d/mirrorlist.msys
RUN echo "Server = https://mirrors.cloud.tencent.com/msys2/msys/\$arch/" >> /etc/pacman.d/mirrorlist.msys
